//
// Created by liaojili on 2023/11/9.
//

#include <stdio.h>
void main(){

    // 有位5评委为参赛的选手打分，分数分别为：{96, 97, 94, 95, 98}，去掉1个最高分和最低分，求平均分；
    double average = 0;
    double arr[5] = {96, 97, 94, 95, 98};
    double max = arr[0];
    double min = arr[0];
    double sum = 0;
    size_t length = sizeof(arr) / sizeof(double);
    for (int i = 0; i < length; ++i) {
        sum += arr[i];
        // 去掉最高分
        if(max < arr[i]){
            max = arr[i];
        }
        // 去掉最低分
        if(min > arr[i]){
            min = arr[i];
        }
    }
    average = (sum - max - min) / (length - 2);
    printf("%.2lf", average);
}